package com.guguskins.back.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.guguskins.back.entity.GuGoods;
import com.guguskins.back.entity.GuInventory;
import com.guguskins.back.entity.bo.InventoryBo;
import com.guguskins.back.entity.vo.InventoryVo;
import com.guguskins.back.entity.vo.PageVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-05-18
 */
public interface GuInventoryService extends IService<GuInventory> {

    /**
     * 批量修改状态
     *
     * @return
     */
    boolean updateRecordStateByIds(List<Long> ids, Integer state);

    /**
     * 添加仓库记录
     */
    GuInventory addInventory(Long userId, String steamId, int type, int source, Long sourceId, Long itemId, BigDecimal itemPrice);

    /**
     * 获取仓库饰品
     */
    PageVo<InventoryVo> getInventory(Long userId, int state, int p, int size,int type);

    /**
     * 获取仓库饰品
     *
     * @param userId steamId
     * @param state  默认1
     * @param p
     * @param size
     * @return 结果
     */
    PageVo<GuGoods> getGoodsInventory(Long userId, int state, int p, int size);

    /**
     * 合同合成
     */
    GuGoods synthetic(Long userId, List<Long> recordIds);

    /**
     * 最好记录
     */
    GuInventory bestInventory(Long userId, List<Integer> sources);

    /**
     * 获取最好记录
     *
     * @param userId
     */
    GuGoods bestSynthetic(Long userId);

    /**
     * 获取箱子记录
     */
    List<GuGoods> getList(long boxId, long size);

    /**
     * 兑换咕币
     */
    boolean exchangeGuCurrency(InventoryBo inventoryBo);

    void sentSynthetic(InventoryBo inventoryBo);

    List<GuGoods> syntheticList(Long userId);

    boolean trade(GuInventory inventory);

//    PageVo<GuGoods> backPage(int p, int size, long userId, int state, String searchKey);

    PageVo<GuInventory> backPage(int p, int size, long userId, int state, String searchKey);

}
